/* ===========================================================================
 *
 *       Filename:  main.cpp
 *
 *    Description:  handwritor debug xyb (qt)
 *
 * - Mode: 644
 * - NOTE. NOT use "dos"
 * - Updated: 2015-04-26 18:35:02
 *
 *        Version:  1.0.0
 *        Created:  2015-04-16 10:13:08
 *       Revision:  1.0.0
 *       Compiler:  moc/g++
 *
 *         Author:  Yui Wong, email: yuiwong@126.com
 *   Organization:  ""
 *        License:  LGPLv3
 *
 *  This file is part of portable-inputmethod.yw.
 *
 *  portable-inputmethod.yw
 *  is free software: you can redistribute it
 *  and/or modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 *  portable-inputmethod.yw
 *  is distributed in the hope that it will be
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with portable-inputmethod.yw.
 *  If not, see <http://www.gnu.org/licenses/>.
 *
 * ===========================================================================
 */
/*
 * main.cpp
 */


#if !defined(ID_QT_VERSION)
#	error "ID_QT_VERSION NOT defined"
#endif

#include <QtCore/QTextCodec>
#include <QtCore/QDebug>

#if (ID_QT_VERSION < 0x050000)
#	include <QtGui/QApplication>
#else
#	include <QtWidgets/QApplication>
#endif

#include "xyb_handwriting_demo.h"


int main (int argc, char *argv[]) {
	xyb_handwriting_demo * hw;
	fprintf(stderr, "%s +%d: %s\n", __FILE__, __LINE__, __func__);
	fflush(stderr);

	QApplication a(argc, argv);
	QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));

	if (argc < 2) {
		fprintf(stderr, "%s +%d: %s: WARNING: USE DFT CONF\n", __FILE__,
			__LINE__, __func__);
		fflush(stderr);
		static xyb_handwriting_demo _hw;
		hw = &_hw;
	} else {
		fprintf(stderr, "%s +%d: %s: USE CONF: %s\n", __FILE__,
			__LINE__, __func__, argv[1]);
		fflush(stderr);
		static xyb_handwriting_demo _hw(argv[1]);
		hw = &_hw;
	}

	hw->show();

	return a.exec();
} /* main */


/*
 * main.cpp
 */
